#include "datacollector.h"

///
/// @param  dir         The directory to look for the files
/// @param  parent      The parent object for QThread
///
/// Constructor to initialize the DataCollector
DataCollector::DataCollector(const QDir &dir, QObject *parent) :
    QThread(parent),
    iterator_(dir, QDirIterator::Subdirectories)
{}

///
/// Starts to collect the data thread based
void DataCollector::run()
{
    while (iterator_.hasNext()) {
        QString entry(iterator_.next());
        if (QFileInfo(entry).suffix().toLower() == "png") {
            fileList_ << entry;
            qDebug() << entry;
            // emit fileCountChanged(fileList_.count());
        }
    }
}
